package com.ianmoone.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;

import org.omg.CORBA.StructMember;

public class ProxyTest {
	public static void main(String[] args) {
		Person zhangsan = new Student("zhangsan");
		InvocationHandler invocationHandler = new StuInvocationHandler<Person>(zhangsan);
		Person stuProxy = (Person) Proxy.newProxyInstance(Person.class.getClassLoader(), 
				new Class<?>[]{Person.class}, invocationHandler);
		stuProxy.giveMoney();
	}
	
}
